/*

#include <iostream>
#include <string>
#include <math.h>



const int MAX_ITERATIONS=10000;
const double PARALLEL_ITERATION_NUMBER = 0.9;

const int MAX_PARALLEL_ITERATIONS = 90;



struct tractStruct{

	double approximationCoefficient_K;
	double approximationCoefficient_N;
	double voltage_U0;
	double stepness_S;

};

double* createTractArray(tractStruct);
double computeVoltageParallelTract(tractStruct, double) ;
double* createParallelTwoTractsArray(tractStruct,tractStruct) ;
double* createConsistentTwoTractsArray(tractStruct,tractStruct);



int main(){
	using namespace std;

	tractStruct tract = {4.0,5.0,2.0,5.0};

	string s = "asd";

	cout << s;

	double* resultTractArray = createTractArray(tract);

	for (int voltage = 0; voltage < MAX_ITERATIONS; voltage++) {
		//cout<<resultTractArray[voltage];
	}

	double* resultParallelTractArray = createParallelTwoTractsArray(tract,tract);

	for (int current = 0; current < MAX_PARALLEL_ITERATIONS; current++) {
		cout<<resultParallelTractArray[current]<<endl;
	}
	cin.get();
	return 0;
}

double* createTractArray(tractStruct tract) {
	double result[MAX_ITERATIONS];
	double s = 0;
	double step = 0;
	for (int voltage = 0; voltage < MAX_ITERATIONS; voltage++) {
		step = abs(pow(voltage - tract.voltage_U0,
			tract.approximationCoefficient_N));

		s = pow(
			1 / tract.approximationCoefficient_K * (1 + step),
			tract.stepness_S);
		result[voltage]=s;

	}

	return result;

}


double* createConsistentTwoTractsArray(tractStruct tract1,tractStruct tract2) {
	double result[MAX_ITERATIONS];
	double*  result1 = createTractArray(tract1);
	double*  result2 = createTractArray(tract2);
	for (int i = 0; i < MAX_ITERATIONS; i++) {
		result[i] = result1[i] + result2[i];

	}

	return result;

}

double* createParallelTwoTractsArray(tractStruct tract1,
	tractStruct tract2) {
		using namespace std;
		double result[MAX_ITERATIONS];
		int i=0;
		for (double current = 0; current < PARALLEL_ITERATION_NUMBER; current += 0.01,i++) {

			double resultVoltage1 = computeVoltageParallelTract(tract1, current);
			double resultVoltage2 = computeVoltageParallelTract(tract2, current);
			result[i] = resultVoltage1 + resultVoltage2;

		}
		return result;

}

double computeVoltageParallelTract(tractStruct tract, double current) {
	double step = pow(
		abs((log10(tract.stepness_S - current))
		/ (tract.approximationCoefficient_K * log10(current))),
		1 / tract.approximationCoefficient_N);
	return (step + tract.voltage_U0);

}

*/